<template>
  <div>
    <van-nav-bar
      title="等待详情"
      left-text="返回"
      right-text="确认完成"
      left-arrow
      @click-left="onClickLeft"
      @click-right="onClickRight"
    />
    <div class="box-ti">
      <div>
        <p>等待时间:</p>
      </div>
      <br />
      <div>
        <van-count-down :time="300000">
          <template #default="timeData">
            <span class="block">{{ timeData.hours }}</span>
            <span class="colon">:</span>
            <span class="block">{{ timeData.minutes }}</span>
            <span class="colon">:</span>
            <span class="block">{{ timeData.seconds }}</span>
          </template>
        </van-count-down>
      </div>
    </div>
    <div class="box-qu">
      <van-cell :title="'订单号：'+codes" icon="todo-list" />
      <van-cell :title="'您的位置：'+addrss" icon="location" />
      <van-cell :title="'您去的目的地：'+aa" icon="smile" />
      <van-cell :title="'时间：'+times" icon="clock" />
      <p class="v-clock">发单人信息：</p>
      <van-cell :title="'手机号：'+'13269637511'" icon="phone" />
      <p class="v-clock">接单人信息：</p>
      <van-cell :title="'接单人：'+'王丽'" icon="manager" />
      <van-cell :title="'手机号：'+'13269637511'" icon="phone" />
      <van-cell :title="'牌照：'+'R79483'" icon="smile-comment" />
      <div>
        <van-goods-action>
          <van-goods-action-icon @click="$router.push('/home')" icon="setting" text="修改地址" />
          <van-goods-action-button
            @click="$router.push('/regis')"
            color="red"
            type="warning"
            text="联系司机"
          />
          <van-goods-action-button @click="pushArr" color="#7232dd" type="danger" text="取消订单" />
        </van-goods-action>
      </div>
    </div>
  </div>
</template>

<script>
import { Toast } from "vant";
export default {
  data() {
    return {
      aa: "",
      times: "",
      codes: "",
      addrss: ""
    };
  },
  mounted() {
    this.aa = this.$store.state.what;
    this.times = this.$store.state.timer;
    this.codes = this.$store.state.rand;
    this.addrss = this.$store.state.addrs;
  },
  methods: {
    onClickLeft() {
      Toast("返回");
      this.$router.push("/home");
    },
    onClickRight() {
      this.$router.push("/eval");
    },
    pushArr() {
      this.$router.push("/cancel");
    }
  }
};
</script>

<style lang="scss" scoped>
.box-ti {
  width: 90%;
  height: 140px;
  box-shadow: 0 0 3px 0px black;
  border-radius: 10px;
  margin: 25px auto;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  .colon {
    display: inline-block;
    margin: 0 4px;
    color: #ee0a24;
  }
  .block {
    display: inline-block;
    width: 60px;
    height: 40px;
    color: #fff;
    font-size: 20px;
    text-align: center;
    background-color: #ee0a24;
    line-height: 40px;
  }
}
.box-qu {
  // position: absolute;
  width: 100%;
  // height: 500px;
  margin: 0 auto;
  border-top: 1px solid #eee;
  bottom: 0;
}
.v-clock {
  width: 200px;
  height: 15px;
  margin-left: 25px;
  border-left: 3px solid red;
  font-size: 11px;
  padding-left: 10px;
  line-height: 15px;
  margin-top: 10px;
}
</style>